package cc.mrbird.febs.utils;

import cc.mrbird.febs.accounting.dto.standardSub.SubMainDetailDTO;
import cc.mrbird.febs.accounting.entity.StandardSub;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class SubjectUtil {
    public static List<SubMainDetailDTO> otherSubjects = new ArrayList<SubMainDetailDTO>(){{
        add(new SubMainDetailDTO("毛利润（预算表）", "e1", "毛利润", "m0", 3, 10, 99, 44, 0.0));
        add(new SubMainDetailDTO("毛利润（按实际社保和工会费）", "e11", "毛利润", "m1", 3, 11, 100, 46, 0.0));
        add(new SubMainDetailDTO("自有（驻场）毛利润", "e2", "毛利润", "m1", 3, 11, 101, 45, 0.0));
        add(new SubMainDetailDTO("自有（驻场）毛利率", "e3", "毛利润", "m1", 3, 11, 102, 45, 0.0));
        add(new SubMainDetailDTO("第三方毛利润", "e4", "毛利润", "m1", 3, 11, 103, 45,0.0));
        add(new SubMainDetailDTO("第三方毛利率", "e5", "毛利润", "m1", 3, 11, 104, 45, 0.0));
        add(new SubMainDetailDTO("毛利润2", "e6", "毛利润2", "m2", 3, 11, 105, 55, 0.0));
        add(new SubMainDetailDTO("毛利率2", "e7", "毛利率2", "m3", 3, 11, 106, 55, 0.0));
        add(new SubMainDetailDTO("毛利润3", "e8", "毛利润3", "m4", 3, 12, 107, 65, 0.0));
        add(new SubMainDetailDTO("毛利率3", "e9", "毛利率3", "m5", 3, 12, 108, 65, 0.0));
        add(new SubMainDetailDTO("补贴合计", "e10", "补助或减免项", CodeConstant.reliefItems, 3,12, 550,60, 0.0));
    }};

    public static Map<String, String> formulaMap = new HashMap<String, String>() {{
       put("e3", "col29/col9");
       put("e5", "col31/col10");
       put("e7", "col39/col8");
       put("e9", "col46/col8");
    }};

    public static List<StandardSub> otherThirdSubjects = new ArrayList<StandardSub>(){{
        StandardSub standardSub = new StandardSub();
        standardSub.setCode("e1");
        standardSub.setSubType(10);
        standardSub.setCalculateRule("【303f416d49fc11ecba500242ac110002】-(【7d9a9f5b49fe11ecba500242ac110002】)-(【9396e2ff4a0311ecba500242ac110002】)-(【d4d63f024a0311ecba500242ac110002】)");
        add(standardSub);
        standardSub = new StandardSub();
        standardSub.setCode("e11");
        standardSub.setSubType(11);
        standardSub.setCalculateRule("【303f416d49fc11ecba500242ac110002】-(【7d9a9f5b49fe11ecba500242ac110002】)-(【9396e2ff4a0311ecba500242ac110002】)-(【d4d63f024a0311ecba500242ac110002】)+(【8210867e4a0311ecba500242ac110002】)+(【c22f36054a0311ecba500242ac110002】)-(【644be5cb4a0411ecba500242ac110002】)-(【6a4b2c414a0411ecba500242ac110002】)");
        add(standardSub);
        standardSub = new StandardSub();
        standardSub.setCode("e2");
        standardSub.setSubType(10);
        standardSub.setCalculateRule("【303f416d49fc11ecba500242ac110002】-(【7d9a9f5b49fe11ecba500242ac110002】)-(【9396e2ff4a0311ecba500242ac110002】)-(【d4d63f024a0311ecba500242ac110002】)+(【8210867e4a0311ecba500242ac110002】)+(【c22f36054a0311ecba500242ac110002】)-(【644be5cb4a0411ecba500242ac110002】)-(【6a4b2c414a0411ecba500242ac110002】)" +
                "-(【8a9959a949fc11ecba500242ac110002】-【cf70193849fd11ecba500242ac110002】-【8a9959a949fc11ecba500242ac110002】/1.06*0.06-(【8a9959a949fc11ecba500242ac110002】/1.06-【cf70193849fd11ecba500242ac110002】+【9f62643849fd11ecba500242ac110002】)*0.06*0.12-【8a9959a949fc11ecba500242ac110002】*0.8*0.0003)");
        add(standardSub);
        standardSub = new StandardSub();
        standardSub.setCode("e3");
        standardSub.setSubType(10);
        standardSub.setCalculateRule("【e2】/【4507048349fc11ecba500242ac110002】");
        add(standardSub);
        standardSub = new StandardSub();
        standardSub.setCode("e4");
        standardSub.setSubType(10);
        standardSub.setCalculateRule("【8a9959a949fc11ecba500242ac110002】-【cf70193849fd11ecba500242ac110002】-【8a9959a949fc11ecba500242ac110002】/1.06*0.06-(【8a9959a949fc11ecba500242ac110002】/1.06-【cf70193849fd11ecba500242ac110002】+【9f62643849fd11ecba500242ac110002】)*0.06*0.12-【8a9959a949fc11ecba500242ac110002】*0.8*0.0003");
        add(standardSub);
        standardSub = new StandardSub();
        standardSub.setCode("e5");
        standardSub.setSubType(10);
        standardSub.setCalculateRule("【e4】/【8a9959a949fc11ecba500242ac110002】");
        add(standardSub);
        standardSub = new StandardSub();
        standardSub.setCode("e6");
        standardSub.setSubType(11);
        standardSub.setCalculateRule("【303f416d49fc11ecba500242ac110002】-(【7d9a9f5b49fe11ecba500242ac110002】)-(【9396e2ff4a0311ecba500242ac110002】)-(【d4d63f024a0311ecba500242ac110002】)+(【8210867e4a0311ecba500242ac110002】)+(【c22f36054a0311ecba500242ac110002】)-(【644be5cb4a0411ecba500242ac110002】)-(【6a4b2c414a0411ecba500242ac110002】)-(【33753bba4a0411ecba500242ac110002】)");
        add(standardSub);
        standardSub = new StandardSub();
        standardSub.setCode("e7");
        standardSub.setSubType(11);
        standardSub.setCalculateRule("【e11】/【303f416d49fc11ecba500242ac110002】");
        add(standardSub);
        standardSub = new StandardSub();
        standardSub.setCode("e8");
        standardSub.setSubType(12);
        standardSub.setCalculateRule("【303f416d49fc11ecba500242ac110002】-(【7d9a9f5b49fe11ecba500242ac110002】)-(【9396e2ff4a0311ecba500242ac110002】)-(【d4d63f024a0311ecba500242ac110002】)-(【33753bba4a0411ecba500242ac110002】)+【82c3c5f94a0411ecba500242ac110002】");
        add(standardSub);
        standardSub = new StandardSub();
        standardSub.setCode("e9");
        standardSub.setSubType(12);
        standardSub.setCalculateRule("【e8】/【303f416d49fc11ecba500242ac110002】");
        add(standardSub);
        standardSub = new StandardSub();
        standardSub.setCode("e10");
        standardSub.setSubType(12);
        standardSub.setCalculateRule("【7095c4f95a0411ecba500242ac110002】+【792faf7e4a0411ecba500242ac110002】+【7d3e77044a0411ecba500242ac110002】");
        add(standardSub);
    }};
}
